package com.fqgj.sentry.manage.dao.impl;

import com.fqgj.common.base.AbstractBaseMapper;
import com.fqgj.sentry.manage.dao.McRolePermissionDao;
import com.fqgj.sentry.manage.entity.McRolePermissionEntity;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * User: ykpbean
 * Date: 2017-07-12
 * Time: 14:21:02.939
 */

@Repository
public class McRolePermissionDaoImpl extends AbstractBaseMapper<McRolePermissionEntity> implements McRolePermissionDao {

    @Override
    public Integer deleteByRoleId(Long roleId) {
        return this.getSqlSession().delete(this.getStatement(".deleteByRoleId"), roleId);
    }

    @Override
    public List<McRolePermissionEntity> findListByRoleId(Long roleId) {
        return this.getSqlSession().selectList(this.getStatement(".findListByRoleId"), roleId);
    }

    @Override
    public List<McRolePermissionEntity> selectListByRolesId(String rolesId) {
        return this.getSqlSession().selectList(this.getStatement(".selectListByRolesId"), rolesId);
    }


    @Override
    public List<McRolePermissionEntity> findPermissionMenuList(Long roleId) {
        return this.getSqlSession().selectList(this.getStatement(".findPermissionMenuList"), roleId);
    }
}